from django.contrib import admin

from nopbx.voicemail.models import Context, Mailbox

class ContextAdmin(admin.ModelAdmin):
    """
    Basic administrative interface for Voicemail contexts.
    """
    list_display = ('name',)

    fieldsets = [
        (None, {'fields': ['name', 'path'], 'classes': ['wide']}),
    ]

admin.site.register(Context, ContextAdmin)


class MailboxAdmin(admin.ModelAdmin):
    """
    Basic administrative interface for the Mailbox.  Needs work (like no changing the Extension!)
    """
    list_display = ('context', 'extension', 'person',)

    fieldsets = [
        (None,            {'fields': ['context', 'extension', 'password'], 'classes': ['wide']}),
        ('Assigned User', {'fields': ['person', 'notify', 'hidefromdir'], 'classes': ['wide']}),
        ('Options',       {'fields': ['saycid', 'envelope', 'sayduration'], 'classes': ['wide']}),
        ('Advanced',      {'fields': ['attach', 'deletevoicemail', 'review', 'operator', 'sendvoicemail', 'forcename', 'forcegreetings', 'tempgreetwarn'], 'classes': ['wide', 'collapse']}),
    ]

admin.site.register(Mailbox, MailboxAdmin)

